package com.gamejelly.broker.message;

import lombok.Data;
import lombok.NonNull;

import java.io.Serializable;

@Data
public class CmdInfo implements Serializable {

    //主路由-类名
    @NonNull
    String mainRoute;

    //次路由-方法名
    @NonNull
    String subRoute;

    //指定路由
    String endPoint;

    private CmdInfo() {

    }

    public static CmdInfo of(String mainRouter, String subRouter) {
        CmdInfo cmdInfo = new CmdInfo();
        cmdInfo.mainRoute = mainRouter;
        cmdInfo.subRoute = subRouter;
        return cmdInfo;
    }

    public static CmdInfo of(String mainRouter, String subRouter, String endPoint) {
        CmdInfo cmdInfo = of(mainRouter, subRouter);
        cmdInfo.endPoint = endPoint;
        return cmdInfo;
    }

}
